<%@ page pageEncoding="UTF-8"%>
<%@ include file="/common/validate.jsp"%>
<%@ include file="function.jsp"%>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>查看新闻</title>
    <link  href="../images/favicon.ico?cache=<%=Math.random()%>" rel="shortcut icon" type="image/x-icon">
    <link rel="stylesheet" href="../css/public.css?cache=<%=Math.random()%>">
    <link rel="stylesheet" href="../css/messages_doctor_mes_add.css?cache=<%=Math.random()%>">
    <link rel="stylesheet" href="../css/sweetalert.css?cache=<%=Math.random()%>" >
    <script src="../js/jquery-1.9.1.min.js"></script>
</head>
<body>
    <%@ include file="../header.jsp"%>
    <!--内容-->
    <div class="containerone">
    <%@ include file="../left_menu.jsp"%>
    <!--右边内容-->
    <div class="right_cont">
<!--右边内容-->
    <div class="message_right_cont_box" id="see_content">

          <div class="message_hos_news_container ui_height">
    <div class="add_doctor_tittle" v-html="option"></div>
          <div class="add_doctor">
              <span>新闻详情</span>
              <a> <button class="back_doctor_mes" @click="back()">返回</button></a>
                </div>
              <div class="mes_see_con_below">
                <span><h1>标题：</h1><span class="mes_news_tittle" v-html="news_detail.title"></span>
                <div class="clearfix"></div>
              </span>
              <span><h1>作者：</h1><span class="mes_news_tittle" v-html="news_detail.author"></span>
              <div class="clearfix"></div></span>
                <span><h2>简介：</h2><span class="mes_news_less_intro"  v-html="news_detail.summary"></span></span>
               <span><p>内容：</p><p  v-html="news_detail.html"></p></span>
            </div>
            <div class="mes_see_edit">
              <button class="back_doctor_mes" @click="edit()"><a>编辑新闻</a></button>
                </div>
         </div>
    </div>
    </div>

    <script src="../js/sweetalert-dev.js"></script>
    <script>
    new Vue({
    el:'#see_content',
    data:{
     news_id:'',
     option:'',
     news_detail:[]
    },
    ready:function(){
    var self = this;
    var see_content = getHrefParms("see_content");
    self.news_id = see_content.news_id;
    self.option = see_content.option;
    console.log(self);
    $.ajax({
    type: 'POST',
    url: "see_content.jsp",
    data: {
    act: "news",
    news_id:self.news_id,
    },
    success: function(res) {
        res = JSON.parse(res);
        self.news_detail = res.data;
        console.log(self.news_detail);
        if (res.errcode == 0) {
        <%--location.href="content.jsp";--%>
        } else {
        swal(res.errmsg);
        }
    },
    });
    },
    methods:{

    decode: function(i) {
    return decodeURI(i);
    },
    edit:function(){
    var self = this;
    locationHerf("edit_content", {
    news_id:self.news_id,
    option:self.option
    });
    },
    back:function(){
    location.href="content.jsp";
    }
    }
    })


    </script>
</body>
</html>
